package cn.microservices.cloud.common.core.entity;

import lombok.Data;

@Data
public class PageEntity extends IdEntity {
    /**
     * 页码
     */
    private Integer pageIndex;

    /**
     * 数量
     */
    private Integer pageSize;

    /**
     * 校验参数
     */
    public void checkParam() {
        if (this.pageIndex == null || this.pageIndex < 0) {
            this.pageIndex = 1;
        }

        if (this.pageSize == null || this.pageSize < 0 || pageSize > 100) {
            this.pageSize = 100;
        }
    }
}

